import 'dart:convert';

import 'package:enterprise_v6_app/app/data/common/choice_bean.dart';
import 'package:enterprise_v6_app/generated/json/base/json_field.dart';
import 'package:enterprise_v6_app/generated/json/co_chemicals_entity.g.dart';
export 'package:enterprise_v6_app/generated/json/co_chemicals_entity.g.dart';

/// 危险化学品实体
@JsonSerializable()
class CoChemicalsEntity extends ChoiceBean {
  CoChemicalsEntity();

  factory CoChemicalsEntity.fromJson(Map<String, dynamic> json) => $CoChemicalsEntityFromJson(json);
  String? alias = '';
  String? cas = '';
  String? chemicalsName = '';
  String? chemicalsSpecies = '';
  String? chemicalsType = '';
  String? chemicalsTypeLabel = '';
  String? companyCode = '';
  String? createBy = '';
  String? createById = '';
  String? createDate = '';
  String? deleted = '';
  String? id = '';
  int? keySupervision = 0;
  String? labelUrl = '';
  String? majorId = '';
  String? maxReservesFang = '';
  String? maxReservesTon = '';
  int? msdsId = 0;
  String? productionCapacityFang = '';
  String? productionCapacityTon = '';
  String? updateBy = '';
  String? updateById = '';
  String? updateDate = '';

  ///是否选择
  bool isSelected = false;

  Map<String, dynamic> toJson() => $CoChemicalsEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

  @override
  String getId() {
    return id ?? '';
  }

  @override
  bool getIsChecked() {
    return isSelected;
  }

  @override
  String getShowName() {
    return chemicalsName ?? '空';
  }

  @override
  setIsChecked(bool isChecked) {
    isSelected = isChecked;
  }
}
